var express = require('express')
var proxy = require('http-proxy-middleware')
var cors = require('cors')
var app = express()

app.use(cors())
app.use(
  ['/api', '/admin-api'],
  proxy({
    target: 'http://api.dfzz.yuejike.com',
    changeOrigin: true,
  })
)

app.listen(8008, function () {
  console.log('CORS-enabled proxy server listening on port 8008')
})
